﻿@inject IStringLocalizer<Foo> Localizer

<ContextMenuZone>
    <TreeView TItem="TreeFoo" Items="@Items" />
    <ContextMenu>
        <ContextMenuItem Text="拷贝" OnClick="OnCopy"></ContextMenuItem>
        <ContextMenuItem Icon="fa-solid fa-paste" Text="粘贴" OnClick="OnPaste"></ContextMenuItem>
    </ContextMenu>
</ContextMenuZone>

@code {
    private List<TreeViewItem<TreeFoo>> Items { get; set; } = TreeFoo.GetTreeItems();

    private Task OnCopy(ContextMenuItem item, object value)
    {
        return Task.CompletedTask;
    }

    private Task OnPaste(ContextMenuItem item, object value)
    {
        return Task.CompletedTask;
    }
}
